<template>
  <div class="header">
    <div class="header-container">
      <div class="logo"></div>
      <div class="navigation-bar" id="navigator" @click="selectNavigator">
        <router-link to="/" exact>首页</router-link>
        <router-link to="/KG" exact>知识图谱</router-link>
        <router-link to="/chat" exact>对话机器人</router-link>
        <router-link to="/about" exact>关于</router-link>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Header",
  data() {
    return {};
  },
  created() {
    // $(".navigation-bar a").each(function (i) {
    //   var $me = $(this);
    //   var lochref = $.trim(window.location.href);
    //   var mehref = $.trim($me.get(0).href);
    //   if (lochref.indexOf(mehref) != -1) {
    //     $me.addClass("active");
    //   } else {
    //     $me.removeClass("active");
    //   }
    // });
  },
  methods: {
    // selectNavigator() {
    //   Array.prototype.forEach.call(
    //     document.querySelectorAll("div[id=navigator] > a"),
    //     removeActiveClass
    //   );
    //   var target = e.target;
    //   target.addClass = "a-active";
    // },
  },
};
</script>


<style scoped>
* {
  margin: 0;
  padding: 0;
}

.header {
  display: block;
  height: 70px;
  background-color: #3d3c3c;
  box-shadow: 0 0 24px rgba(12, 2, 3, 0.3);
  backdrop-filter: blur(3px);
  width: 100%;
  min-width: 870px;
}

.header-container {
  margin-left: calc(50% - 450px);
  margin-right: auto;
}

.navigation-bar {
  display: flex;
  height: 70px;
  align-items: center;
  float: left;
}

.navigation-bar a {
  display: block;
  float: left;
  color: rgb(255, 255, 255);
  font-size: 14px;
  padding: 8px 20px;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: all 0.5s;
  margin: 0px 17px;
}

.navigation-bar a:hover {
  color: #9ebfd8;
  border: 3px solid;
  border-radius: 8px;
}

.navigation-bar .active {
  color: #5badec;
}
</style>
